# include <stdio.h>
int main()
{
	int i,j,n,m;
	char c;
	c=0;
	char a[100],b[100];
	for (i=0;(a[i]=getchar())!='\n';i++);
	for (j=0;(b[j]=getchar())!='\n';j++);
	for (n=0;n<i;n++)
	{
		if (a[n]>c)
		{
			c=a[n];
			m=n;
		}
	}
	for (i=0;i<=m;i++)
	printf("%c",a[i]);
	for (j=0;b[j]!='\n';j++)
	printf("%c",b[j]);
	for (i=m+1;a[i]!='\n';i++)
	printf("%c",a[i]);
	return 0;
}
